import request from '@/utils/request'

import { baseUrlConfig, baseUrl } from '@/config/config'
const basePath = baseUrlConfig.businessBaseUrl
// 获取分页列表
export const recycleUnitPageList: (data: any) => Promise<[]> = (data) => {
  return request({
    url: baseUrl + '/externalUnitBin/findPage',
    method: 'post',
    data
  })
}

// 恢复
export const oneRecover = (data: any) => {
  return request({
    url: baseUrl + '/externalUnitBin/restore',
    method: 'put',
    data
  })
}

// 批量恢复
export const oneRecoverAll = (data: any) => {
  return request({
    url: baseUrl + '/externalUnitBin/putIds',
    method: 'put',
    data
  })
}
// 删除
export const clear = (data: any) => {
  return request({
    url: baseUrl + '/externalUnitBin/del',
    method: 'delete',
    data
  })
}

// 清空
export const emptyRecover = (data:any) => {
  return request({
    url: baseUrl + '/externalUnitBin/delIds',
    method: 'delete',
    data
  })
}
// 清空时间
export const selectSet = (data: any) => {
  return request({
    url: baseUrl + '/externalUnitBin/put',
    method: 'put',
    data
  })
}
export const updateRecycleTime: (data: any) => Promise<[]> = (data) => {
  return request({
    url: basePath + '/secure/recycleUnit/updateRecycleTime',
    method: 'post',
    data
  })
}

// 检查记录回收站分页
export const examineList: (data: any) => Promise<[]> = (data) => {
  return request({
    url: baseUrl + '/safetyInspeBin/findPage',
    method: 'post',
    data
  })
}

// 清空时间
export const examineSelectSet = (data: any) => {
  return request({
    url: basePath + '/secure/recycleExamine/selectSet?pageType=' + data.pageType,
    method: 'get',
    data
  })
}

// 恢复
export const examineoneRecover = (data: any) => {
  return request({
    url: baseUrl + '/safetyInspeBin/restore',
    method: 'put',
    data
  })
}
//批量恢复
export const examineoneRecoverAll = (data: any) => {
  return request({
    url: baseUrl + '/safetyInspeBin/putIds',
    method: 'put',
    data
  })
}
// 清空
export const clearSafteInspe = (data: any) => {
  return request({
    url: baseUrl + '/safetyInspeBin/delIds',
    method: 'delete',
    data
  })
}
// 删除
export const examineemptyRecover = (data:any) => {
  return request({
    url: baseUrl + '/safetyInspeBin/del',
    method: 'delete',
    data
  })
}

// 培训记录回收站分页
export const cultivateList: (data: any) => Promise<[]> = (data) => {
  return request({
    url: baseUrl + '/safetyTrainBin/findPage',
    method: 'post',
    data
  })
}

// 清空时间
export const cultivateSelectSet = (data: any) => {
  return request({                                                                                                                                                 
    url: baseUrl + '/secure/recycleCultivate/selectSet?pageType=' + data.pageType,
    method: 'get'
  })
}

// 恢复
export const cultivateoneRecover = (data: any) => {
  return request({
    url: baseUrl + '/safetyTrainBin/restore',
    method: 'put',
    data
  })
}
// 批量恢复
export const cultivateoneRecoverAll = (data: any) => {
  return request({
    url: baseUrl + '/safetyTrainBin/putIds',
    method: 'put',
    data
  })
}
// 清空
export const cultivateemptyRecover = (data:any) => {
  return request({
    url: basePath + '/safetyTrainBin/delIds',
    method: 'delete',
    data
  })
}

// 隐患清单回收站分页
export const earlyList: (data: any) => Promise<[]> = (data) => {
  return request({
    url: basePath + '/tcdmSecureHazardListRecycle/findPage',
    method: 'post',
    data
  })
}

// 清空时间
export const earlySelectSet = (data: any) => {
  return request({
    url: basePath + '/secure/recycleEarly/selectSet?pageType=' + data.pageType,
    method: 'get'
  })
}

// 恢复
export const earlyoneRecover = (data: any) => {
  return request({
    url: basePath + '/tcdmSecureHazardListRecycle/recover',
    method: 'post',
    data
  })
}

export const checkListDel = (data: any) => {
  return request({
    url: basePath + '/tcdmSecureHazardListRecycle/del',
    method: 'delete',
    data
  })
}


// 清空
export const earlyemptyRecover = () => {
  return request({
    url: basePath + '/tcdmSecureHazardListRecycle/deleteAll',
    method: 'delete'
  })
}

// 隐患清单回收站分页
export const assessList: (data: any) => Promise<[]> = (data) => {
  return request({
    url: basePath + '/tcdmSecureHazardAssessmentRecycle/findPage',
    method: 'post',
    data
  })
}

// 清空时间
export const assessSelectSet = (data: any) => {
  return request({
    url: basePath + '/secure/recycleAssess/selectSet?pageType=' + data.pageType,
    method: 'get'
  })
}

// 恢复
export const assessoneRecover = (data: any) => {
  return request({
    url: basePath + '/tcdmSecureHazardAssessmentRecycle/recover',
    method: 'post',
    data
  })
}

export const assessRecycleDel = (data:any) => {
  return request({
    url: basePath + '/tcdmSecureHazardAssessmentRecycle/del',
    method: 'delete',
    data
  })
}

// 清空
export const assessemptyRecover = () => {
  return request({
    url: basePath + '/tcdmSecureHazardAssessmentRecycle/deleteAll',
    method: 'delete'
  })
}

// 用户监测分页
export const usersList: (data: any) => Promise<[]> = (data) => {
  return request({
    url: basePath + '/sysMonitor/serMonituor/find/page',
    method: 'post',
    data
  })
}

// 运行监测分页
export const setvList: (data: any) => Promise<[]> = (data) => {
  return request({
    url: basePath + '/sysMonitor/setveMonitor/find/page',
    method: 'post',
    data
  })
}

// 数据库监测分页
export const databaseList: (data: any) => Promise<[]> = (data) => {
  return request({
    url: basePath + '/sysMonitor/databaseMonitor/find/page',
    method: 'post',
    data
  })
}

// 服务监测分页
export const serveList: (data: any) => Promise<[]> = (data) => {
  return request({
    url: basePath + '/sysMonitor/serveMonitor/find/page',
    method: 'post',
    data
  })
}

// 当日用户访问总数
export const selectCount = () => {
  return request({
    url: basePath + '/sysMonitor/serMonituor/selectCount',
    method: 'get'
  })
}

// 在线用户数
export const selectOnline = () => {
  return request({
    url: basePath + '/sysMonitor/serMonituor/selectOnline',
    method: 'get'
  })
}
// 查询所有外部单位
export const unitList = () => {
  return request({
    url: basePath + '/department/findAll',
    method: 'get'
  })
}
